<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <!-- v-else必须和v-if的元素是相邻的兄弟元素 -->
      <!-- <h1 v-if="awesome">Vue is awesome!</h1>
      <h1 v-else>Oh no 😢</h1> -->

      <!-- tempalte是一个占位的空标签 -->
      <!-- tempalte是vue提供的一个标签, 是一个vue自带的组件 -->
      <!-- <template v-if="awesome">
        <h1>Vue is awesome!</h1>
        <h1>Vue is awesome!</h1>
        <h1>Vue is awesome!</h1>
        <h1>Vue is awesome!</h1>
      </template>
      <template v-else>
        <div>Oh no 😢</div>
      </template> -->

      <!-- 也是要和v-if相邻 -->
      <div v-if="num === 1">111111</div>
      <div v-else-if="num === 2">222222</div>
      <div v-else>333333</div>
    </div>

    <script src="../Vue.js"></script>
    <script>
      new Vue({
        el: "#app",
        data: {
          awesome: false,
          num: 2,
        },
      });
    </script>
  </body>
</html>
